<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "{{%hj_project_fh}}".
 *
 * @property int $id 主键id
 * @property int $type 项目类型0排查,1检测
 * @property int $scale 项目规模,0小型,1中型,3大型
 * @property string $project_manage 项目经理
 * @property string $skiller 技术人员
 * @property string $inner 内业人员
 * @property string $worker 工人
 * @property int $update_at 修改时间
 * @property string $inputer 修改人
 * @property int $project_id 关联项目Id
 * @property mixed project
 */
class ProjectFh extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%project_fh}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['scale', 'update_at', 'project_id','inputer', 'status', 'percent', 'fhPlan_start_at', 'fhComplete_at'], 'integer'],
            [['project_manage', 'skiller', 'inner', 'worker'], 'string', 'max' => 255],
        ];
    }

    public function getProject(){
        return $this->hasOne(Project::class, ['id' => 'project_id']);
    }

    public function extraFields()
    {
        $fields['project'] = function(){
            return  $this->project;
        };
    }

}
